﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="group_personal_frame.aspx.cs" Inherits="Ccit.OA.Group.group_personal_frame" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>人员分组</title>
    <script language="javascript" type="text/javascript" src="../script/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="../script/StringClass_Ext.js"></script>
    <script language="javascript" type="text/javascript" src="../script/jsonlib.js"></script>
    <script language="javascript" src="../script/jwindow.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
    <script type="text/javascript">
        function doAdd()
        {
             var vType = document.getElementById("_hidType").value; 
             var oPageParam="type="+vType ;
             var oEncodeParam=base64encode(oPageParam); 
            var url = "group_personal_edit.aspx?"+oEncodeParam;
            self.frames[1].document.location.href = url;
        }
        function doSelect()
        { 
            var nodeIndex = window.frames['iFrmTree'].document.getElementById("trvDepAddress").selectedNodeIndex;
            var userId = window.frames['iFrmEdit'].document.getElementById("_hidSelUserId").value;
            if(userId!=""||userId!=null)
            {
                 document.getElementById("_hidUserId").value=userId;      
            }
            if(nodeIndex!="0")
            {
                OpenUserMultiSelect("_hidUserId","_hidUserName","","DoSaveDeatail"); 
            }
            else
            {
                alert("没有您要选择的节点信息,请先添加节点!")
            }
        }
        function  DoSaveDeatail()
        {
            var UserId = document.getElementById("_hidUserId").value;      
            if(UserId!="")
            {
                self.frames[0].initializeAddNew(UserId); 
            }
        }
        function doDel()
        { 
            var userId = window.frames['iFrmEdit'].document.getElementById("_hidUID").value;
            if(userId!="")
            {
                  var GroupId = window.frames['iFrmEdit'].document.getElementById("_hidGroupId").value;
                  if(confirm("是否确定要删除当前选定的信息?")) 
                             PageMethods.DoOperate(GroupId,userId,ClientCallBack);   
            }
            else
            {
                alert("尚未有您要删除的数据!")
            }
        }
        function ClientCallBack(vResult)
        {
                eval("resultObj ="+vResult)
                if(resultObj.result!="-1")
                {
                     alert(resultObj.message);
                     var vPageParam = "GroupId=" + resultObj.resultSign;
                     var encodeParam = base64encode(vPageParam);
                     self.frames[1].document.location.href = "group_personal_list.aspx?" + encodeParam;
                }
                else
                {
                    alert(resultObj.message);
                }
        }
    </script>
</head>
<body>
    <ccit:ActionForm id="form1" runat="server">
    <input  type="hidden" id="_hidUserName" runat="server" />
    <input  type="hidden" id="_hidUserId" runat="server" />
    <input  type="hidden" id="_hidType" runat ="server" />
     <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager> 
    <table class="tbToolbar" cellpadding="0" cellspacing="0" width="98%" align="center">
                    <tr>
                        <td align="left">
                            <div class="tbSeparator"></div>
                        </td>
                        <td width="100%" class="titlebar">  
                            人员分组
                        </td>                
                        <td align="right">
                            <nobr> 
                                <a  id="lnbAdd" Runat="server" class="linktext"  
                                href="javascript:doAdd()">
							        <img src="../images/toolbar/new.gif" border="0">新增
						        </a>						        
						         <a  id="A1" Runat="server" class="linktext"  
                                href="javascript:doSelect()">
							        <img src="../images/toolbar/search.gif" border="0">成员选择
						        </a>
						         <a  id="lnbDel" Runat="server" class="linktext"  
                                href="javascript:doDel()">
							        <img src="../images/toolbar/Delete.gif" border="0">删除成员
						        </a>
                             </nobr>
                        </td> 
                    </tr>
       </table>
        <table class="tableborder" cellpadding="0" cellspacing="0" width="98%" height="94.2%" align="center">
        <tr>
            <td width="25%">
                <iframe id="iFrmTree" name="iFrmTree" height="99%" width="98%" scrolling="auto"
						src="" style="BORDER-RIGHT: #000000 1px solid" frameborder="0"></iframe>
            </td>
            <td width="75%">
                <iframe id="iFrmEdit" name="iFrmEdit" height="99%" width="98%" scrolling="auto"
						src="" frameborder="0"></iframe>
            </td>
        </tr>
    </table>  
    <script type="text/javascript">
    <!--
        $(document).ready(function(){   
             var vType = document.getElementById("_hidType").value; 
             var oPageParam="type="+vType ;
             var oEncodeParam=base64encode(oPageParam); 
            self.frames[0].document.location.href = "group_personal_tree.aspx?"+oEncodeParam; 
        });
    //-->
    </script>
    </ccit:ActionForm>
</body>
</html>
